package com.yamvc.utils
{
	import flash.events.EventDispatcher;
	import flash.events.IEventDispatcher;
	import flash.utils.Dictionary;
	
	public class HashMap extends EventDispatcher
	{
		private var _map:Dictionary = new Dictionary();
		public function HashMap(target:IEventDispatcher=null)
		{
			super(target);
		}
		
		public function put(key,value:*):void{
			if(_map[key]!=null){
				//TODO: dispatch valueChange event.
				//TODO: create HashMapEvent class with key and value properties.
			}
			_map[key] = value;
		}
		
		public function get(key:*):*{
			if(_map[key]==null||_map[key]==undefined) return null;
			return _map[key];
		}
	}
}